<template>
  <el-dialog class="textDialog" :visible.sync="visible" :title="name" width="500px" :close-on-click-modal="false" :close-on-press-escape="false">
    <div class="textBox" v-html="text"></div>
  </el-dialog>
</template>

<script>
export default {
  data () {
    return {
      visible: false,
      name: '',
      text: ''
    }
  },
  methods: {
    // 显示弹窗
    init (name, text) {
      this.visible = true
      this.name = name
      this.text = text
    }
  }
}
</script>
<style lang="scss">
.textDialog{
  .el-dialog__header{
    .el-dialog__title{
      font-size: 14px;
      font-weight: bold;
    }
    border-bottom: 1px solid #f2f2f2;
  }
  .el-dialog__body{
    padding: 15px 20px;
  }
  .textBox{
    padding: 10px;
  }
}
</style>
